﻿#ifndef HEADUI_H
#define HEADUI_H
#pragma once
#include <QWidget>
#include <QListWidgetItem>
#include <QVector>
#include <QSize>
#include <QIcon>
#include <QFileDialog>
#include <QFile>
#include <QFileInfo>
#include <QMouseEvent>
#include "opdb.h"

namespace Ui {
class HeadUI;
}

class HeadUI : public QWidget
{
    Q_OBJECT

public:
    explicit HeadUI(QWidget *parent = nullptr);
    ~HeadUI();
    void init(QString path);
    void mousePressEvent(QMouseEvent *event);//鼠标点击
    void mouseMoveEvent(QMouseEvent *event);//鼠标移动
    void mouseReleaseEvent(QMouseEvent *event);//鼠标释放
private slots:
    void on_btn_save_clicked();


    void on_listWidget_currentRowChanged(int currentRow);

    void on_toolButton_clicked();

    void on_btn_upload_clicked();

private:
    Ui::HeadUI *ui;
    bool isPressedWidget;//isPressedWidget和last用来控制窗口移动
    QPoint last;
    QVector<QString> m_vec;
    QString m_path;//用于记录选取的头像路径
};

#endif // HEADUI_H
